//
//  GPDock.m
//  cocoapodText
//
//  Created by apple on 16/8/10.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "GPDock.h"
#import "ShiPei.h"
#import <Foundation/Foundation.h>
@interface GPDock()
@end

@implementation GPDock
-(instancetype)initWithFrame:(CGRect)frame{
    self=[super initWithFrame:frame];
    if (self) {
        //自动伸缩高度可伸缩，右边距可以伸缩
        self.autoresizingMask=UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleRightMargin;
        //设置背景图片
        [self setBackgroundColor:FUIColorFromRGB(0x247bcf)];
        [self addTabItems];
    }
    return self;
}

//添加Tab选项卡
- (void)addTabItems
{
    // 信息概况
    [self addSingleTabWithSelectedImage:@"fs_main_menu_01_1.png" unSelectedImage:@"fs_main_menu_01_0.png" labelText:@"信息概况" weight:1];
    // 能耗分析
    [self addSingleTabWithSelectedImage:@"fs_main_menu_02_1.png" unSelectedImage:@"fs_main_menu_02_0.png" labelText:@"能耗分析" weight:2];
    // 能耗对标
    [self addSingleTabWithSelectedImage:@"fs_main_menu_03_1.png" unSelectedImage:@"fs_main_menu_03_0.png" labelText:@"能耗对标" weight:3];
    // 定额分析
    [self addSingleTabWithSelectedImage:@"fs_main_menu_04_1.png" unSelectedImage:@"fs_main_menu_04_0.png" labelText:@"定额分析" weight:4];
    // 能源调度
    [self addSingleTabWithSelectedImage:@"fs_main_menu_05_1.png" unSelectedImage:@"fs_main_menu_05_0.png" labelText:@"能源调度" weight:5];
    // 节能足迹
    [self addSingleTabWithSelectedImage:@"fs_main_menu_06_1.png" unSelectedImage:@"fs_main_menu_06_0.png" labelText:@"节能足迹" weight:6];
    // 消息订阅
    [self addSingleTabWithSelectedImage:@"fs_main_menu_07_1.png" unSelectedImage:@"fs_main_menu_07_0.png" labelText:@"消息订阅" weight:7];
    // 密码维护
    [self addSingleTabWithSelectedImage:@"fs_main_menu_08_1.png" unSelectedImage:@"fs_main_menu_08_0.png" labelText:@"密码维护" weight:8];
    // 能耗分布
//    [self addSingleTabWithSelectedImage:@"fs_main_menu_09_1.png" unSelectedImage:@"fs_main_menu_09_0.png" labelText:@"能耗分布" weight:9];
    
    [self changeTabItemStyle:[self->TabItem1 tag]];
}

- (void)addSingleTabWithSelectedImage:(NSString *)selectedImage unSelectedImage:(NSString *)unSelectedImage labelText:(NSString *)text weight:(int)weight
{
    FSDockItem *tabItem=[[FSDockItem alloc]initWithFrame:CGRectMake(0, [ShiPei CGFloatMakeScale:GPDockItemHeight] * (weight-1)+[ShiPei CGFloatMakeScale:CommonBarH+20], [ShiPei CGFloatMakeScale:GPDockItemWidth], [ShiPei CGFloatMakeScale:GPDockItemHeight])];
    [tabItem setSelectedImage:selectedImage];
    [tabItem setUnSelectedImage:unSelectedImage];
    [tabItem setLabelText:text];
    tabItem.userInteractionEnabled=YES;
    UITapGestureRecognizer *forgetPass =[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tabItemTouchEvent:)];
    [tabItem addGestureRecognizer:forgetPass];
    tabItem.tag = weight - 1;
    [self addSubview:tabItem];
    switch (tabItem.tag) {
        case 0:
            self->TabItem1=tabItem;
            break;
        case 1:
            self->TabItem2=tabItem;
            break;
        case 2:
            self->TabItem3=tabItem;
            break;
        case 3:
            self->TabItem4=tabItem;
            break;
        case 4:
            self->TabItem5=tabItem;
            break;
        case 5:
            self->TabItem6=tabItem;
            break;
        case 6:
            self->TabItem7=tabItem;
            break;
        case 7:
            self->TabItem8=tabItem;
            break;
        case 8:
            self->TabItem9=tabItem;
            break;
        default:
            break;
    }
}



-(void)ckickGDDockWithTab:(int)tabTag{
    if ([self.dockDelegate respondsToSelector:@selector(switchMainByTabItem:originalTab:destinationTab:)]) {
        [self.dockDelegate switchMainByTabItem:self originalTab:tabTag destinationTab:tabTag];
    }
    //[self changeTabItemStyle:tabTag];
}


//设置触摸事件
- (void)tabItemTouchEvent:(id)sender{
    [CommonTool updateValueWithKey:@"MessageSubscriptionAction" value:menuClick];
    UITapGestureRecognizer *singleTap = (UITapGestureRecognizer *)sender;
    int tabTag=[[NSString stringWithFormat: @"%ld", (long)[singleTap view].tag] intValue];
    if ([self.dockDelegate respondsToSelector:@selector(switchMainByTabItem:originalTab:destinationTab:)]) {
        [self.dockDelegate switchMainByTabItem:self originalTab:tabTag destinationTab:tabTag];
    }
    //[self changeTabItemStyle:tabTag];
}

-(void)changeTabItemStyle:(NSInteger)tag{
    switch (tag) {
        case 0:
            [self->TabItem1.menuAllBackItem setHidden:NO];
            [self->TabItem2.menuAllBackItem setHidden:YES];
            [self->TabItem3.menuAllBackItem setHidden:YES];
            [self->TabItem4.menuAllBackItem setHidden:YES];
            [self->TabItem5.menuAllBackItem setHidden:YES];
            [self->TabItem6.menuAllBackItem setHidden:YES];
            [self->TabItem7.menuAllBackItem setHidden:YES];
            [self->TabItem8.menuAllBackItem setHidden:YES];
            [self->TabItem9.menuAllBackItem setHidden:YES];
            
            [self->TabItem1.menuSelectImageView setHidden:NO];
            [self->TabItem2.menuSelectImageView setHidden:YES];
            [self->TabItem3.menuSelectImageView setHidden:YES];
            [self->TabItem4.menuSelectImageView setHidden:YES];
            [self->TabItem5.menuSelectImageView setHidden:YES];
            [self->TabItem6.menuSelectImageView setHidden:YES];
            [self->TabItem7.menuSelectImageView setHidden:YES];
            [self->TabItem8.menuSelectImageView setHidden:YES];
            [self->TabItem9.menuSelectImageView setHidden:YES];
            
            [self->TabItem1.menuUnSelectImageView setHidden:YES];
            [self->TabItem2.menuUnSelectImageView setHidden:NO];
            [self->TabItem3.menuUnSelectImageView setHidden:NO];
            [self->TabItem4.menuUnSelectImageView setHidden:NO];
            [self->TabItem5.menuUnSelectImageView setHidden:NO];
            [self->TabItem6.menuUnSelectImageView setHidden:NO];
            [self->TabItem7.menuUnSelectImageView setHidden:NO];
            [self->TabItem8.menuUnSelectImageView setHidden:NO];
            [self->TabItem9.menuUnSelectImageView setHidden:NO];
            
            [self->TabItem1.meunItemNameLabel setTextColor:FUIColorFromRGB(0x247bcf)];
            [self->TabItem2.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem3.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem4.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem5.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem6.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem7.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem8.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem9.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            break;
        case 1:
            [self->TabItem2.menuAllBackItem setHidden:NO];
            [self->TabItem1.menuAllBackItem setHidden:YES];
            [self->TabItem3.menuAllBackItem setHidden:YES];
            [self->TabItem4.menuAllBackItem setHidden:YES];
            [self->TabItem5.menuAllBackItem setHidden:YES];
            [self->TabItem6.menuAllBackItem setHidden:YES];
            [self->TabItem7.menuAllBackItem setHidden:YES];
            [self->TabItem8.menuAllBackItem setHidden:YES];
            [self->TabItem9.menuAllBackItem setHidden:YES];
            
            [self->TabItem2.menuSelectImageView setHidden:NO];
            [self->TabItem1.menuSelectImageView setHidden:YES];
            [self->TabItem3.menuSelectImageView setHidden:YES];
            [self->TabItem4.menuSelectImageView setHidden:YES];
            [self->TabItem5.menuSelectImageView setHidden:YES];
            [self->TabItem6.menuSelectImageView setHidden:YES];
            [self->TabItem7.menuSelectImageView setHidden:YES];
            [self->TabItem8.menuSelectImageView setHidden:YES];
            [self->TabItem9.menuSelectImageView setHidden:YES];
            
            [self->TabItem2.menuUnSelectImageView setHidden:YES];
            [self->TabItem1.menuUnSelectImageView setHidden:NO];
            [self->TabItem3.menuUnSelectImageView setHidden:NO];
            [self->TabItem4.menuUnSelectImageView setHidden:NO];
            [self->TabItem5.menuUnSelectImageView setHidden:NO];
            [self->TabItem6.menuUnSelectImageView setHidden:NO];
            [self->TabItem7.menuUnSelectImageView setHidden:NO];
            [self->TabItem8.menuUnSelectImageView setHidden:NO];
            [self->TabItem9.menuUnSelectImageView setHidden:NO];
            
            [self->TabItem2.meunItemNameLabel setTextColor:FUIColorFromRGB(0x247bcf)];
            [self->TabItem1.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem3.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem4.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem5.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem6.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem7.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem8.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem9.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            break;
        case 2:
            [self->TabItem3.menuAllBackItem setHidden:NO];
            [self->TabItem2.menuAllBackItem setHidden:YES];
            [self->TabItem1.menuAllBackItem setHidden:YES];
            [self->TabItem4.menuAllBackItem setHidden:YES];
            [self->TabItem5.menuAllBackItem setHidden:YES];
            [self->TabItem6.menuAllBackItem setHidden:YES];
            [self->TabItem7.menuAllBackItem setHidden:YES];
            [self->TabItem8.menuAllBackItem setHidden:YES];
            [self->TabItem9.menuAllBackItem setHidden:YES];
            
            [self->TabItem3.menuSelectImageView setHidden:NO];
            [self->TabItem2.menuSelectImageView setHidden:YES];
            [self->TabItem1.menuSelectImageView setHidden:YES];
            [self->TabItem4.menuSelectImageView setHidden:YES];
            [self->TabItem5.menuSelectImageView setHidden:YES];
            [self->TabItem6.menuSelectImageView setHidden:YES];
            [self->TabItem7.menuSelectImageView setHidden:YES];
            [self->TabItem8.menuSelectImageView setHidden:YES];
            [self->TabItem9.menuSelectImageView setHidden:YES];
            
            [self->TabItem3.menuUnSelectImageView setHidden:YES];
            [self->TabItem2.menuUnSelectImageView setHidden:NO];
            [self->TabItem1.menuUnSelectImageView setHidden:NO];
            [self->TabItem4.menuUnSelectImageView setHidden:NO];
            [self->TabItem5.menuUnSelectImageView setHidden:NO];
            [self->TabItem6.menuUnSelectImageView setHidden:NO];
            [self->TabItem7.menuUnSelectImageView setHidden:NO];
            [self->TabItem8.menuUnSelectImageView setHidden:NO];
            [self->TabItem9.menuUnSelectImageView setHidden:NO];
            
            [self->TabItem3.meunItemNameLabel setTextColor:FUIColorFromRGB(0x247bcf)];
            [self->TabItem2.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem1.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem4.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem5.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem6.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem7.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem8.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem9.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            break;
        case 3:
            [self->TabItem4.menuAllBackItem setHidden:NO];
            [self->TabItem2.menuAllBackItem setHidden:YES];
            [self->TabItem3.menuAllBackItem setHidden:YES];
            [self->TabItem1.menuAllBackItem setHidden:YES];
            [self->TabItem5.menuAllBackItem setHidden:YES];
            [self->TabItem6.menuAllBackItem setHidden:YES];
            [self->TabItem7.menuAllBackItem setHidden:YES];
            [self->TabItem8.menuAllBackItem setHidden:YES];
            [self->TabItem9.menuAllBackItem setHidden:YES];
            
            [self->TabItem4.menuSelectImageView setHidden:NO];
            [self->TabItem2.menuSelectImageView setHidden:YES];
            [self->TabItem3.menuSelectImageView setHidden:YES];
            [self->TabItem1.menuSelectImageView setHidden:YES];
            [self->TabItem5.menuSelectImageView setHidden:YES];
            [self->TabItem6.menuSelectImageView setHidden:YES];
            [self->TabItem7.menuSelectImageView setHidden:YES];
            [self->TabItem8.menuSelectImageView setHidden:YES];
            [self->TabItem9.menuSelectImageView setHidden:YES];
            
            [self->TabItem4.menuUnSelectImageView setHidden:YES];
            [self->TabItem2.menuUnSelectImageView setHidden:NO];
            [self->TabItem3.menuUnSelectImageView setHidden:NO];
            [self->TabItem1.menuUnSelectImageView setHidden:NO];
            [self->TabItem5.menuUnSelectImageView setHidden:NO];
            [self->TabItem6.menuUnSelectImageView setHidden:NO];
            [self->TabItem7.menuUnSelectImageView setHidden:NO];
            [self->TabItem8.menuUnSelectImageView setHidden:NO];
            [self->TabItem9.menuUnSelectImageView setHidden:NO];
            
            [self->TabItem4.meunItemNameLabel setTextColor:FUIColorFromRGB(0x247bcf)];
            [self->TabItem2.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem3.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem1.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem5.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem6.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem7.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem8.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem9.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            break;
        case 4:
            [self->TabItem5.menuAllBackItem setHidden:NO];
            [self->TabItem2.menuAllBackItem setHidden:YES];
            [self->TabItem3.menuAllBackItem setHidden:YES];
            [self->TabItem4.menuAllBackItem setHidden:YES];
            [self->TabItem1.menuAllBackItem setHidden:YES];
            [self->TabItem6.menuAllBackItem setHidden:YES];
            [self->TabItem7.menuAllBackItem setHidden:YES];
            [self->TabItem8.menuAllBackItem setHidden:YES];
            [self->TabItem9.menuAllBackItem setHidden:YES];
            
            [self->TabItem5.menuSelectImageView setHidden:NO];
            [self->TabItem2.menuSelectImageView setHidden:YES];
            [self->TabItem3.menuSelectImageView setHidden:YES];
            [self->TabItem4.menuSelectImageView setHidden:YES];
            [self->TabItem1.menuSelectImageView setHidden:YES];
            [self->TabItem6.menuSelectImageView setHidden:YES];
            [self->TabItem7.menuSelectImageView setHidden:YES];
            [self->TabItem8.menuSelectImageView setHidden:YES];
            [self->TabItem9.menuSelectImageView setHidden:YES];
            
            [self->TabItem5.menuUnSelectImageView setHidden:YES];
            [self->TabItem2.menuUnSelectImageView setHidden:NO];
            [self->TabItem3.menuUnSelectImageView setHidden:NO];
            [self->TabItem4.menuUnSelectImageView setHidden:NO];
            [self->TabItem1.menuUnSelectImageView setHidden:NO];
            [self->TabItem6.menuUnSelectImageView setHidden:NO];
            [self->TabItem7.menuUnSelectImageView setHidden:NO];
            [self->TabItem8.menuUnSelectImageView setHidden:NO];
            [self->TabItem9.menuUnSelectImageView setHidden:NO];
            
            [self->TabItem5.meunItemNameLabel setTextColor:FUIColorFromRGB(0x247bcf)];
            [self->TabItem2.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem3.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem4.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem1.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem6.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem7.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem8.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem9.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            break;
        case 5:
            [self->TabItem6.menuAllBackItem setHidden:NO];
            [self->TabItem2.menuAllBackItem setHidden:YES];
            [self->TabItem3.menuAllBackItem setHidden:YES];
            [self->TabItem4.menuAllBackItem setHidden:YES];
            [self->TabItem5.menuAllBackItem setHidden:YES];
            [self->TabItem1.menuAllBackItem setHidden:YES];
            [self->TabItem7.menuAllBackItem setHidden:YES];
            [self->TabItem8.menuAllBackItem setHidden:YES];
            [self->TabItem9.menuAllBackItem setHidden:YES];
            
            [self->TabItem6.menuSelectImageView setHidden:NO];
            [self->TabItem2.menuSelectImageView setHidden:YES];
            [self->TabItem3.menuSelectImageView setHidden:YES];
            [self->TabItem4.menuSelectImageView setHidden:YES];
            [self->TabItem5.menuSelectImageView setHidden:YES];
            [self->TabItem1.menuSelectImageView setHidden:YES];
            [self->TabItem7.menuSelectImageView setHidden:YES];
            [self->TabItem8.menuSelectImageView setHidden:YES];
            [self->TabItem9.menuSelectImageView setHidden:YES];
            
            [self->TabItem6.menuUnSelectImageView setHidden:YES];
            [self->TabItem2.menuUnSelectImageView setHidden:NO];
            [self->TabItem3.menuUnSelectImageView setHidden:NO];
            [self->TabItem4.menuUnSelectImageView setHidden:NO];
            [self->TabItem5.menuUnSelectImageView setHidden:NO];
            [self->TabItem1.menuUnSelectImageView setHidden:NO];
            [self->TabItem7.menuUnSelectImageView setHidden:NO];
            [self->TabItem8.menuUnSelectImageView setHidden:NO];
            [self->TabItem9.menuUnSelectImageView setHidden:NO];
            
            [self->TabItem6.meunItemNameLabel setTextColor:FUIColorFromRGB(0x247bcf)];
            [self->TabItem2.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem3.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem4.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem5.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem1.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem7.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem8.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem9.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            break;
        case 6:
            [self->TabItem7.menuAllBackItem setHidden:NO];
            [self->TabItem2.menuAllBackItem setHidden:YES];
            [self->TabItem3.menuAllBackItem setHidden:YES];
            [self->TabItem4.menuAllBackItem setHidden:YES];
            [self->TabItem5.menuAllBackItem setHidden:YES];
            [self->TabItem6.menuAllBackItem setHidden:YES];
            [self->TabItem1.menuAllBackItem setHidden:YES];
            [self->TabItem8.menuAllBackItem setHidden:YES];
            [self->TabItem9.menuAllBackItem setHidden:YES];
            
            [self->TabItem7.menuSelectImageView setHidden:NO];
            [self->TabItem2.menuSelectImageView setHidden:YES];
            [self->TabItem3.menuSelectImageView setHidden:YES];
            [self->TabItem4.menuSelectImageView setHidden:YES];
            [self->TabItem5.menuSelectImageView setHidden:YES];
            [self->TabItem6.menuSelectImageView setHidden:YES];
            [self->TabItem1.menuSelectImageView setHidden:YES];
            [self->TabItem8.menuSelectImageView setHidden:YES];
            [self->TabItem9.menuSelectImageView setHidden:YES];
            
            [self->TabItem7.menuUnSelectImageView setHidden:YES];
            [self->TabItem2.menuUnSelectImageView setHidden:NO];
            [self->TabItem3.menuUnSelectImageView setHidden:NO];
            [self->TabItem4.menuUnSelectImageView setHidden:NO];
            [self->TabItem5.menuUnSelectImageView setHidden:NO];
            [self->TabItem6.menuUnSelectImageView setHidden:NO];
            [self->TabItem1.menuUnSelectImageView setHidden:NO];
            [self->TabItem8.menuUnSelectImageView setHidden:NO];
            [self->TabItem9.menuUnSelectImageView setHidden:NO];
            
            [self->TabItem7.meunItemNameLabel setTextColor:FUIColorFromRGB(0x247bcf)];
            [self->TabItem2.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem3.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem4.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem5.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem6.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem1.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem8.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem9.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            break;
        case 7:
            [self->TabItem8.menuAllBackItem setHidden:NO];
            [self->TabItem2.menuAllBackItem setHidden:YES];
            [self->TabItem3.menuAllBackItem setHidden:YES];
            [self->TabItem4.menuAllBackItem setHidden:YES];
            [self->TabItem5.menuAllBackItem setHidden:YES];
            [self->TabItem6.menuAllBackItem setHidden:YES];
            [self->TabItem7.menuAllBackItem setHidden:YES];
            [self->TabItem1.menuAllBackItem setHidden:YES];
            [self->TabItem9.menuAllBackItem setHidden:YES];
            
            [self->TabItem8.menuSelectImageView setHidden:NO];
            [self->TabItem2.menuSelectImageView setHidden:YES];
            [self->TabItem3.menuSelectImageView setHidden:YES];
            [self->TabItem4.menuSelectImageView setHidden:YES];
            [self->TabItem5.menuSelectImageView setHidden:YES];
            [self->TabItem6.menuSelectImageView setHidden:YES];
            [self->TabItem7.menuSelectImageView setHidden:YES];
            [self->TabItem1.menuSelectImageView setHidden:YES];
            [self->TabItem9.menuSelectImageView setHidden:YES];
            
            [self->TabItem8.menuUnSelectImageView setHidden:YES];
            [self->TabItem2.menuUnSelectImageView setHidden:NO];
            [self->TabItem3.menuUnSelectImageView setHidden:NO];
            [self->TabItem4.menuUnSelectImageView setHidden:NO];
            [self->TabItem5.menuUnSelectImageView setHidden:NO];
            [self->TabItem6.menuUnSelectImageView setHidden:NO];
            [self->TabItem7.menuUnSelectImageView setHidden:NO];
            [self->TabItem1.menuUnSelectImageView setHidden:NO];
            [self->TabItem9.menuUnSelectImageView setHidden:NO];
            
            [self->TabItem8.meunItemNameLabel setTextColor:FUIColorFromRGB(0x247bcf)];
            [self->TabItem2.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem3.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem4.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem5.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem6.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem7.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem1.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem9.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            break;
        case 8:
            [self->TabItem9.menuAllBackItem setHidden:NO];
            [self->TabItem2.menuAllBackItem setHidden:YES];
            [self->TabItem3.menuAllBackItem setHidden:YES];
            [self->TabItem4.menuAllBackItem setHidden:YES];
            [self->TabItem5.menuAllBackItem setHidden:YES];
            [self->TabItem6.menuAllBackItem setHidden:YES];
            [self->TabItem7.menuAllBackItem setHidden:YES];
            [self->TabItem8.menuAllBackItem setHidden:YES];
            [self->TabItem1.menuAllBackItem setHidden:YES];
            
            [self->TabItem9.menuSelectImageView setHidden:NO];
            [self->TabItem2.menuSelectImageView setHidden:YES];
            [self->TabItem3.menuSelectImageView setHidden:YES];
            [self->TabItem4.menuSelectImageView setHidden:YES];
            [self->TabItem5.menuSelectImageView setHidden:YES];
            [self->TabItem6.menuSelectImageView setHidden:YES];
            [self->TabItem7.menuSelectImageView setHidden:YES];
            [self->TabItem8.menuSelectImageView setHidden:YES];
            [self->TabItem1.menuSelectImageView setHidden:YES];
            
            [self->TabItem9.menuUnSelectImageView setHidden:YES];
            [self->TabItem2.menuUnSelectImageView setHidden:NO];
            [self->TabItem3.menuUnSelectImageView setHidden:NO];
            [self->TabItem4.menuUnSelectImageView setHidden:NO];
            [self->TabItem5.menuUnSelectImageView setHidden:NO];
            [self->TabItem6.menuUnSelectImageView setHidden:NO];
            [self->TabItem7.menuUnSelectImageView setHidden:NO];
            [self->TabItem8.menuUnSelectImageView setHidden:NO];
            [self->TabItem1.menuUnSelectImageView setHidden:NO];
            
            [self->TabItem9.meunItemNameLabel setTextColor:FUIColorFromRGB(0x247bcf)];
            [self->TabItem2.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem3.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem4.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem5.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem6.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem7.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem8.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            [self->TabItem1.meunItemNameLabel setTextColor:[UIColor whiteColor]];
            break;
        default:
            break;
    }
}
@end
